#include <iostream>
#include <ctime>

using namespace std;

#define N 20

void sta(int a[N],int *m,int *n);

int main ( )
{
    int a[N],i,n=0,m=0;
    int *p=a,*p1=&n,*p2=&m;

    srand((unsigned int)time(0));

    for(i=0;i<N;i++)
    {
        a[i]=rand( )%50;
        cout<<a[i]<<" ";
    }

    sta(p,p1,p2);

    cout<<endl<<"the number of odd number is "<<m<<" the number of even number is"<<n<<endl;

    cin>>i;
    return 0;
}

void sta(int a[N],int *m,int *n)
{
    int i;

    for(i=0;i<N;i++)
    {
        if(a[i]%2==0)
        {
            (*m)++;
        }
        else (*n)++;
    }
}

